<#include "template/template.ftl"/>
<@template _title="教师评教">

<div class="row" id="evaluation">
    <div class="panel panel-info">
        <div class="panel-heading">
            <div class="form-inline">
                <div class="form-group">
                    <label class="control-label">选择学期:</label>
                    <select id="semester_select" class="form-control" v-model="selectSemester" @change="chooseSemester">
                        <option value="0">==请选择==</option>
                        <option v-for="semester in semesterList" :value="semester.Key" v-text="semester.Value"></option>
                    </select>
                </div>
                <a href="javascript:;" class="btn btn-primary" role="button" @click="showEvaluationList"
                   v-show="!refreshing && showList">刷新教师列表</a>
            </div>
        </div>
        <div class="alert alert-danger" style="display: none" onclick="$(this).hide();">
            <a class="close" href="#" aria-hidden="true">&times;</a>
            <strong>{{ msg }}</strong>
        </div>
        <hr/>
        <div class="panel-body">
            <table class="table table-striped table-bordered table-hover" v-show="showList">
                <thead>
                <tr role="row">
                    <th class="col-md-1 col-xs-1">序号</th>
                    <th class="col-md-1 col-xs-1">状态</th>
                    <th class="col-md-1 col-xs-2">教师姓名</th>
                    <th class="col-md-4 col-xs-4">授课班级</th>
                    <th class="col-md-1 col-xs-1">评分</th>
                    <th class="col-md-4 col-xs-3">评语</th>
                </tr>
                </thead>
                <tbody>
                <tr v-for="(ea, index) in evaluationList">
                    <td>{{ index + 1 }}</td>
                    <td class="success" v-if="ea.Cpzt === 1">已评</td>
                    <td class="danger" v-else>未评</td>
                    <td>{{ ea.Jsmc }}</td>
                    <td>{{ ea.Jxbs }}</td>
                    <td>{{ ea.Zf }}</td>
                    <td>{{ ea.Pyu }}</td>
                </tr>
                </tbody>
            </table>
            <br/>
            <form class="form-horizontal" style="margin: auto;width: 95%;" v-show="showList" @submit.prevent="submitEvaluation">
                <div class="form-group">
                    <div class="input-group">
                        <input type="number" id="fens" name="fens" class="form-control" v-model="evaluation.fens"
                               min="1" max="5" required/>
                        <label class="input-group-addon" for="fens">星&nbsp;好&nbsp;评</label>
                    </div>
                </div>
                <div class="form-group">
                    <label for="pingyu">&nbsp;评&nbsp;语:</label>
                    <textarea name="pingyu" id="pingyu" class="form-control" v-model="evaluation.pingyu"
                              rows="4" minlength="1" required></textarea>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-info btn-lg">一键评教</button>
                </div>
            </form>
        </div>
    </div>
</div>

<#assign _pagejs>
<!--<script src="https://unpkg.com/vue-resource/dist/vue-resource.min.js"></script>-->
<script src="//cdn.bootcss.com/vue-resource/1.3.3/vue-resource.min.js"></script>

<script src="${base}/assets/js/evaluation.js"></script>
</#assign>
</@template>